<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改')"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body>
<div class="main-content">
    <form id="form-change-edit" class="form-horizontal" AUTOCOMPLETE="OFF">
        <input name="id" id="id" type="hidden" th:value="${emp.id}"/>
        <h4 class="form-header h4">基本信息</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">工号：</label>
                    <div class="col-sm-8">
                        <input th:value="${emp.badge}" class="form-control" readonly="readonly" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">姓名：</label>
                    <div class="col-sm-8">
                        <input th:value="${emp.name}" class="form-control" readonly="readonly" type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">公司名称：</label>
                    <div class="col-sm-8">
                        <input th:value="${emp.compName}" class="form-control" readonly="readonly" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">部门名称：</label>
                    <div class="col-sm-8">
                        <input th:value="${emp.depName}" class="form-control" readonly="readonly" type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">岗位名称：</label>
                    <div class="col-sm-8">
                        <input th:value="${emp.jobName}" class="form-control" readonly="readonly" type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <h4 class="form-header h4">修改信息</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">证件类型：</label>
                    <div class="col-sm-8">
                        <select name="CertType" id="CertType" class="form-control m-b"
                                th:with="type=${@dict.getType('eCD_CertType')}">
                            <option value="">请选择</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                    th:selected="${emp.CertType+'' == dict.dictValue}"
                                    th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">证件编号：</label>
                    <div class="col-sm-8">
                        <input id="CertNo" name="CertNo" th:value="${emp.CertNo}" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">颁发机构：</label>
                    <div class="col-sm-8">
                        <input id="payOrg" name="payOrg" th:value="${emp.payOrg}" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">颁发日期：</label>
                    <div class="col-sm-8">
                        <input id="BeginDate" name="BeginDate" th:value="${emp.BeginDate}" class="form-control laydate-demo-1" type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">有效期：</label>
                    <div class="col-sm-8">
                        <input id="Term" name="Term" th:value="${emp.Term}" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">有效截止日期：</label>
                    <div class="col-sm-8">
                        <input id="EndDate" name="EndDate" th:value="${emp.EndDate}" class="form-control laydate-demo-2" type="text"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">是否失效：</label>
                    <div class="col-sm-8">
                        <select id="isDisable" name="isDisable" class="form-control m-b">
                            <option value="">请选择</option>
                            <option value="0" th:selected="${emp.isDisable == false}">否</option>
                            <option value="1" th:selected="${emp.isDisable == true}">是</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">备注：</label>
                    <div class="col-sm-8">
                        <input id="Remark" name="Remark" th:value="${emp.Remark}" class="form-control" type="text"/>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>


<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: datetimepicker-js"/>

<script th:inline="javascript">

    var prefix = ctx + "bgInfo/certificates";

    $(function () {
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-1',
                type: 'date'
            });
        });

        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-2',
                type: 'date'
            });
        });
    });


    function submitHandler() {
        if ($.validate.form()) {
            var data = $("#form-change-edit").serializeArray();
            $.operate.save(prefix + "/edit", data);
        }
    }
</script>
</body>
</html>
